package com.example.testfullcalendar.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class SimpleFormatDateUtils {

    /**
     *  时间格式转换
     * @param datetime 'yyyyMMddHHmmss'
     * @return 'yyyy-MM-dd HH:mm:ss'
     */
    public static String strToFormatStr(String datetime) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        LocalDateTime ldt = LocalDateTime.parse(datetime,dtf);
        DateTimeFormatter fa = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        return ldt.format(fa);
    }
}
